#include<iostream>
#include<vector>
using namespace std;

class Solution
{
public:
    vector<int> runningSum(vector<int>& nums)
    {
        vector<int> sumnums;
        sumnums.resize(nums.size(), 0);
        for (int i = 0; i < sumnums.size(); i++)
        {
            if (i == 0)
            {
                sumnums[i] = nums[i];
            }
            else
                sumnums[i] = sumnums[i - 1] + nums[i];
        }
        return sumnums;
    }
};

int main()
{
    Solution s;
    vector<int> num{ 1,2,3,4,5,6,7,8,9 };
    vector<int> nums=s.runningSum(num);
    for (int e : nums)
    {
        cout << e << " ";
    }
    return 0;
}